<template>
<div >
  <div v-if="getqycode === '1'"  class="dashboard-editor-container" style="padding:0px; ">

    <el-row :gutter="12" style="padding:0 6px 0 0;margin-bottom:16px;  " >
      <!-- 图片部分-->

      <div class=" d1"  >
        <div class="tou">
        <div class="  s1" >
          <div class="  z1" style="padding: 0;margin: 0;border-style: none;">
            <el-image
              style="margin-left: 20px; margin-top: 5px;"
              :src="require('@/assets/images/36.png')">

            </el-image>
          </div>

          <div  class="  y1" >


            <el-button class="an3" ><router-link class="link-type" :to="'/shou'" style=" color: whitesmoke">成果展示</router-link></el-button>

            <el-button class="an3" ><router-link class="link-type" :to="'/mwnhugongshi'" style=" color: whitesmoke">转化公示</router-link></el-button>

            <el-button class="an3" ><router-link class="link-type" :to="'/liucheng'" style=" color: whitesmoke">转化流程</router-link></el-button>


          </div>

          <div class=" y2">
            <el-button class="an2" style="background-color: rgba(0, 0, 0, 0.1);" v-if="roleId==10" @click="handleRecord">登录</el-button>
            <el-button class="an6" style="background-color: rgba(0, 0, 0, 0.1);" v-if="roleId==10" @click="handleRego">注册</el-button>
            <el-button class="an4" style="background-color: rgba(0, 0, 0, 0.1);" @click="handleBackground" v-show="roleId==1||roleId==11||roleId==12||roleId==13||roleId==14">
              进入后台</el-button>
          </div>
        </div>
      </div>

        <div class="x1" >
          <div  class="clearfix" >
            <div style="padding:90px 0 0 80px;">
              <span style="font-size: 30px; color: whitesmoke"><b>科技成果</b></span>
            </div>
            <div style="padding:20px 0 0 80px;">
              <span style="font-size: 22px; color: whitesmoke"><b>建设知识产权运营体系，构筑科技成果聚集高地</b></span>
            </div>

            <el-autocomplete style="padding:60px 0 0 80px; " type="primary" class="sousuo" v-model="queryParams.resultName"
                      :fetch-suggestions="querySearchAsync"
                      placeholder="请输入成果名称进行检索" >

            </el-autocomplete>

            <el-button class="an1" @click="handQuery">搜索</el-button>






          </div>
          <div  class="clearfix" style="padding:70px 0 0 80px;">

            <span style="font-size: 20px; color: whitesmoke"><b>首页·成果展示</b></span>

          </div>
        </div>


      </div>


    </el-row>


    <el-row :gutter="12" style="padding:0 175px 0 175px;margin-bottom:16px; ">

      <el-card style=" border-style: solid; border-color: lightblue;" class="box-card" shadow="always ">
        <div style="padding:0 0 0 0;margin-bottom:16px;height: 60px" >
          <div >
            <el-tabs v-model="activeName" @tab-click="handleClick">
              <el-tab-pane label="筛选条件：" name="first">
                <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"  label-width="98px">
                <el-form-item label="负责人学院" prop="firstCollege">
                  <el-select
                    class="custom-select"
                    v-model="queryParams.firstCollege"
                    placeholder="请选择负责人学院"
                    clearable
                  >
                    <el-option
                      v-for="dict in dict.type.cxcy_college"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    />
                  </el-select>
                </el-form-item>
                  <el-form-item label="立项时间" prop="projectTime">
                    <el-date-picker
                      class="time-dage"
                      v-model="dateRange"
                      value-format="yyyy-MM-dd"
                      type="daterange"
                      range-separator="-"
                      start-placeholder="开始日期"
                      end-placeholder="结束日期"
                    ></el-date-picker>
                  </el-form-item>
                  <el-form-item label="签约状态" prop="signingStatus">
                    <template>
                      <el-select
                        class="custom-select"
                        v-model="queryParams.signingStatus"
                        placeholder="请选择签约状态"
                        clearable
                      >
                        <el-option
                          v-for="dict in dict.type.cxcy_signing_status"
                          :key="dict.value"
                          :label="dict.label"
                          :value="dict.value"
                        />
                      </el-select>
                    </template>
                  </el-form-item>
                    <el-button type="primary" icon="el-icon-search" class="an" style="font-size: 15px; width: 90px; color: #FFFFFF; float: right;"  @click="handleQuery">搜索</el-button>
                </el-form>

              </el-tab-pane>
              <el-tab-pane label="技术领域 >" name="second">
                <el-button class="sx" @click="handleResult('0')">新能源</el-button>
                <el-button class="sx" @click="handleResult('1')">新兴信息产业</el-button>
                <el-button class="sx" @click="handleResult('2')">节能环保</el-button>
                <el-button class="sx" @click="handleResult('3')">高端装备制造业</el-button>
                <!--<el-button class="sx">科技成果鉴定</el-button>
                <el-button class="sx">成熟的设想</el-button>-->
                <el-button class="sx" @click="handleResult('4')">新材料</el-button>
                <el-button class="sx" @click="handleResult('5')">生物产业</el-button>
                <el-button class="sx" @click="handleResult('6')">新医药</el-button>
                <el-button class="sx" @click="handleResult('7')">新化工</el-button>
                <!--<el-button class="sx">科技成果鉴定</el-button>
                <el-button class="sx">成熟的设想</el-button>-->
                <el-button class="sx" @click="handleResult('8')">其他</el-button>
              </el-tab-pane>
              <el-tab-pane label="成果类别 >" name="third">
                <el-button class="sx" @click="handleType('0')">创新训练项目</el-button>
                <el-button class="sx" @click="handleType('1')">创业训练项目</el-button>
                <el-button class="sx" @click="handleType('2')">创业实践项目</el-button>
              </el-tab-pane>


              <el-tab-pane label="合作对象 >" name="fourth">
                <el-button class="sx" @click="handleGrade('0')">个人用户</el-button>
                <el-button class="sx" @click="handleGrade('1')">企业用户</el-button>
                <el-button class="sx" @click="handleGrade('2')">个人用户和企业用户</el-button>
              </el-tab-pane>

             <!-- <el-tab-pane label="技术领域 >" name="five">
                <el-button class="sx" @click="handleTech('0')">新能源</el-button>
                <el-button class="sx" @click="handleTech('1')">新兴信息产业</el-button>
                <el-button class="sx" @click="handleTech('2')">节能环保</el-button>
                <el-button class="sx" @click="handleTech('3')">高端装备制造业</el-button>
                <el-button class="sx" @click="handleTech('4')">新材料</el-button>
                <el-button class="sx" @click="handleTech('5')">生物产业</el-button>
                <el-button class="sx" @click="handleTech('6')">新医药</el-button>
                <el-button class="sx" @click="handleTech('7')">新化工</el-button>
                <el-button class="sx" @click="handleTech('8')">其他</el-button>
              </el-tab-pane>-->
            </el-tabs>
          </div>

        </div>
      </el-card>
    </el-row>
    <el-form :data="achievementList">
      <el-row :gutter="12" style="padding:0 175px 0 175px;margin-bottom:16px;">
        <!-- 展示-->
        <el-card style=" border-style: solid; border-color: lightblue;" v-for="(item, index) in achievementList" :key="index" class="box-card" shadow="always ">
          <div  class="big_box" >

            <div  class="z" >
              <el-image
                v-if="item.picturePath1!=null"
                style="width: 100%;  height: 280px;border-radius: 10px;"
                :src="item.picturePath1">
              </el-image>
              <el-image
                v-if="item.picturePath1==null"
                style="width: 100%;  height: 280px;border-radius: 10px;"
                :src="require('@/assets/images/13.png')">

              </el-image>
            </div>
            <div  class="c"></div>
            <div  class="y" >

              <div  style="width: 100%;height: 20px">
                <h2 ><b>{{item.resultName}}</b></h2>
              </div>
              <div  style="width: 100% " >
                <el-descriptions :column="3"  style="font-size: 16px">
                  <template slot="extra" >
                    <el-button type="danger" class="an" v-if="item.signingStatus==0">未签约</el-button>
                    <el-button type="success" class="an" v-if="item.signingStatus==1">已签约</el-button>
                    <el-button type="primary" class="an" @click="handleDetail(item.id)">展示详情</el-button>
                  </template>
                  <el-descriptions-item label="负责人姓名">{{item.firstName}}</el-descriptions-item>
                  <el-descriptions-item label="技术领域"><dict-tag :options="dict.type.cxcy_technology" :value="item.technology"/></el-descriptions-item>
                  <!--<el-descriptions-item label="负责人专业">{{item.firstMajor}}</el-descriptions-item>-->
                  <!--<el-descriptions-item label="负责人年级">{{item.firstGrade}}</el-descriptions-item>-->
                  <el-descriptions-item label="负责人学院"> <dict-tag :options="dict.type.cxcy_college" :value="item.firstCollege"/></el-descriptions-item>
                  <el-descriptions-item label="成果类别"><dict-tag :options="dict.type.cxcy_result_category" :value="item.resultCategory"/></el-descriptions-item>
                  <el-descriptions-item label="合作对象"><dict-tag :options="dict.type.cxcy_cooperative_object" :value="item.cooperativeObject"/></el-descriptions-item>
                  <el-descriptions-item label="立项时间">{{item.projectTime}}</el-descriptions-item>
                  <!--<el-descriptions-item label="成果类型"> <dict-tag :options="dict.type.cxcy_result_type" :value="item.resultType"/></el-descriptions-item>-->
                  <!--<el-descriptions-item label="指导教师姓名">{{item.advisorName1}}</el-descriptions-item>
                  <el-descriptions-item label="指导教师专业">{{item.advisorMajor1}}</el-descriptions-item>
                  <el-descriptions-item label="指导教师职称" :span="2">{{item.advisorTitl1}}</el-descriptions-item>-->
                 <!-- <el-descriptions-item label="技术领域"><dict-tag :options="dict.type.cxcy_technology" :value="item.technology"/></el-descriptions-item>-->
                  <el-descriptions-item label="成果情况" :span="3">{{ getTruncatedText(item.resultIntroduction, 200) }}</el-descriptions-item>
                </el-descriptions>
              </div>
            </div>
          </div>
        </el-card>
      </el-row>
    </el-form>

    <div style="padding:0 175px 0 175px;margin-bottom:16px;text-align: center;" >
      <div class="block">
        <el-pagination
          v-show="total>0"
          :total="total"
          @current-change="handleCurrentChange"
          :current-page="pageCurrent"
          :page-size="10"
          layout="total, prev, pager, next, jumper"
        >
        </el-pagination>
      </div>

    </div>
    </div>

  <div v-cloak>
  <div v-if="getqycode != '1'" class="fullscreen-container" >
    <div class="loading-background">
      <div class="loading-text">
        正在加载中，请稍候...
      </div>
      <div class="loading-spinner"></div>
    </div>
  </div>
  </div>

</div>
</template>

<script>
// import datePanel from "@/components/DatePanel/DatePanel";
import {getUserProfile} from "@/api/system/user";
import { getCodeImg, getAccessToken} from "@/api/login";
import userAvatar from "@/views/system/user/profile/userAvatar";
import userInfo from "@/views/system/user/profile/userInfo";
import resetPwd from "@/views/system/user/profile/resetPwd";
import { listNotice, getNotice} from "@/api/system/notice";
import {delMenu, getMenu, listMenu, listMenu1, getRouter, listNormal} from "@/api/library/application/application";
import {getNumber} from "@/api/library/application/application";
import {mapGetters, mapState} from "vuex";
import watermark from "watermark-dom";
import {updateUserProfile} from "@/api/system/user";
import log from "@/views/monitor/job/log";
import { listInner, getInner, delInner, addInner, updateInner } from "@/api/library/msg/inner";
import { admitlistAchievement, listAchievement, getAchievement, delAchievement, addAchievement, updateAchievement,aduitAchievement,signTransform,getTransform,getRoleId } from "@/api/module/cjl/achievement";
//import Cookies from 'js-cookie'
import Cookies from "js-cookie";
export default {
  name: "Profile",
  dicts: ['cxcy_result_category','cxcy_result_type','cxcy_result_grade','cxcy_result_source','cxcy_technology','cxcy_isno','cxcy_cooperative_object','cxcy_result_year','cxcy_result_background','cxcy_college','cxcy_major','cxcy_signing_status'],
  components: { userAvatar, userInfo, resetPwd },
  props: {
    user: {
      type: Object,
    }
  },
  data() {
    return {
      user: '',
      // 以下websocket
      wsIsRun: false,
      // 定义ws对象
      webSocket: null,
      // ws连接次数
      wsNumber: 0,
      // ws请求链接（类似于ws后台地址）
      ws: '',
      // ws定时器
      wsTimer: null,
      // 以上websocket
      unreadMsgNums: 0,
      unreadMsgNumsShow: '',
      hasConnected: false,
      item: {
        resultIntroduction: '这是一个需要限制字符数的字段'
      },
      // 日期范围
      dateRange: [],
      roleId: '',
      getqycode: '',
      // 遮罩层
      loading: true,
      activeIndex: '1',
      activeIndex2: '1',
      visible: false,
      input: '',
      // 总条数
      total: 0,
      // 当前页
      pageCurrent: 1,
      date:new Date(),
      roleGroup: {},
      froma:{},
      postGroup: {},
      activeTab: "userinfo",
      activeName: 'first',
      cover:"",
      //switch开关初始值
      value:"1",
      //通知公告标题
      titleNotice:"",
      //部门id
      deptId:"",
      //主页链表显示
      categoryList: "",
      activeName1: 'first',
      activeName2:"first",
      menuList: [],
      List:[],
      menuOptions: [],
      List1:[],
      title: "",
      product: "", // 分类列表
      normalList:[],
      contentList: [],
      // 成果信息表格数据
      achievementList: [],
      xiaoxi:{
        // 是否显示弹出层（用户查询）
        open: false,
        // 弹出层标题（用户查询）
        title: "",
      },
      currSelect:1,
      open: false,
      innerList:[],
      rules: {
      },
      loginForm: {
        username: "",
        password: "",
        rememberMe: false,
        code: "",
        uuid: "",
      },
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        userId: null,
        resultName: null,
        resultType: null,
        resultIntroduction: null,
        innovationPoint: null,
        competitionExperience: null,
        picturePath1: null,
        picturePath2: null,
        resultCategory: null,
        resultGrade: null,
        resultSource: null,
        resultBackground: null,
        resultMeaning: null,
        projectTime: null,
        technology: null,
        completionUnit: null,
        applyName: null,
        applyNumber: null,
        applyTime: null,
        auditState: null,
        auditTime: null,
        auditName: null,
        auditNumber: null,
        isShow: null,
        firstName: null,
        firstGrade: null,
        firstMajor: null,
        firstNumber: null,
        firstCollege: null,
        firstPhone: null,
        firstIdnumber: null,
        secondName: null,
        secondGrade: null,
        secondMajor: null,
        secondNumber: null,
        secondCollege: null,
        secondPhone: null,
        secondIdnumber: null,
        thirdName: null,
        thirdGrade: null,
        thirdMajor: null,
        thirdNumber: null,
        thirdCollege: null,
        thirdPhone: null,
        thirdIdnumber: null,
        fourthName: null,
        fourthGrade: null,
        fourthMajor: null,
        fourthNumber: null,
        fourthCollege: null,
        fourthPhone: null,
        fourthIdnumber: null,
        fifthName: null,
        fifthGrade: null,
        fifthMajor: null,
        fifthNumber: null,
        fifthCollege: null,
        fifthPhone: null,
        fifthIdnumber: null,
        advisorName1: null,
        advisorTitl1: null,
        advisorMajor1: null,
        advisorNumber1: null,
        advisorName2: null,
        advisorTitl2: null,
        advisorMajor2: null,
        advisorNumber2: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null,
        signingStatus: null,
        cooperativeObject: null,
        resultYear: null,
        sixthName: null,
        sixthGrade: null,
        sixthMajor: null,
        sixthNumber: null,
        sixthCollege: null,
        sixthPhone: null,
        sixthIdnumber: null,
        seventhName: null,
        seventhGrade: null,
        seventhMajor: null,
        seventhNumber: null,
        seventhCollege: null,
        seventhPhone: null,
        seventhIdnumber: null,
        eighthName: null,
        eighthGrade: null,
        eighthMajor: null,
        eighthNumber: null,
        eighthCollege: null,
        eighthPhone: null,
        eighthIdnumber: null,
        ninthName: null,
        ninthGrade: null,
        ninthMajor: null,
        ninthNumber: null,
        ninthCollege: null,
        ninthPhone: null,
        ninthIdnumber: null,

      },
      calendarParams:{
        orderByColumn:"endTime",
        isAsc:"desc"
      },
      messageParams:{
        pageNum: 1,
        pageSize: 6,
        orderByColumn:"createTime",
        isAsc:"desc"
      },

      // 公告表格数据
      noticeList: [],
      // 日程列表
      todayCalendar:[],

    };

  },

  created() {
    this.getqycode = '1';
    getRoleId().then(res => {
      this.roleId = res;
    });
    this.getList();
    this.wsIsRun = true
    this.wsNumber = 1
    this.wsInit();

    console.log("name:"+ this.getqycode)
    // code 解析，企业微信登录使用
    const geturl = window.location.href
    console.log("geturl:"+geturl)
    const getqyinfo = geturl.split('?')[1]   //qycode=1001&qyname=%E4%BC%81%E4%B8%9A%E5%BF%99
    const getqys = getqyinfo.split('&')  //['qycode=1001', 'qyname=%E4%BC%81%E4%B8%9A%E5%BF%99%E5%95%8A%E5%95%8A%E5%95%8A']
    console.log("getqys:"+getqys[0])
    const getqycode =  getqys[0].split('=')[1]
    console.log("getqycode:"+getqycode)
    const getqycode2 =  getqycode.split('code%3D')[1];
    const getqystate = getqys[1].split('=')[1]
    console.log('qycode:',getqycode,'getqystate:',getqystate)
    console.log("code:"+getqycode)
    this.getqycode=getqycode
    this.vxgoindex(getqycode);
   /* setTimeout( ()=>{
      this.getqycode='1'
    },500);*/

  },

  methods: {
    //cb 回调函数，将处理好的数据推回
    querySearchAsync(queryString, cb) {
      let projectJson= JSON.parse(JSON.stringify(this.achievementList).replace(/resultName/g,"value"));
      let results = queryString ? projectJson.filter(this.createStateFilter(queryString)) : projectJson;
      clearTimeout(this.timeout);
      this.timeout = setTimeout(() => {
        cb(results);
      }, 0.5*1000);
    },
    //根据输入的字段进行筛选
    createStateFilter(queryString) {
      return (state) => {
        return (state.value.toString().toLowerCase().indexOf(queryString.toLowerCase()) === 0);
      };
    },

    //以上都是cb回调函数
    // 企业微信自登录-移动端
    vxgoindex(val) {  //start
      const code = val;
      console.log('this.code：' + code)
      this.loading = true;
      getAccessToken(code).then((res) => {
        this.loginForm = {
          username: res.username,
          password: res.password
        };
          this.handleLogin();

      }).catch(err => {
        console.log("有异常信息", err);
        //异常信息
        this.loading = false;
      });

    }, //end
    handleLogin() {
      this.getqycode='1'
          this.$store.dispatch("Login", this.loginForm).then(() => {
            this.$router.push({ path: "/index" }).then(() => {
              location.reload();
            });
          })
    },
    //进入后台刷新
    handleBackground(){
      this.$router.push({ path: "/index" }).then(() => {
        location.reload();
      });

    },
    //登录
    handleRecord(){
      this.$router.push({ path: "/login1" })
    },
    //注册
    handleRego(){
      this.$router.push({ path: "/register1" })
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /**控制成果简介显示*/
    getTruncatedText(text, maxLength) {
      if (!text) return '';

      if (text.length > maxLength) {
        return text.substring(0, maxLength) + '......';
      }

      return text;
    },
   // 分页触发
    handleCurrentChange(val) {
      this.queryParams.pageNum = val
      this.pageCurrent = val
      this.getList(val)
    },
    /** 查询成果信息 */
    getList() {
      console.log(this.queryParams.signingStatus+"22223")
      this.queryParams.beginTime=this.dateRange[0]
      this.queryParams.endTime=this.dateRange[1]
      this.loading = true;
      admitlistAchievement(this.queryParams).then(response => {
        this.achievementList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /** 搜索成果名称 */
    handQuery(){
      // this.queryParams.resultName = this.input
      this.getList();
    },
    /** 搜索技术领域 */
    handleResult(category){
      this.queryParams.technology=category;
      this.getList();
      this.queryParams.technology='';
    },
    /** 搜索成果类型 */
    handleType(type){
      this.queryParams.resultType=type;
      this.getList();
      this.queryParams.resultType='';
    },
    /** 搜索合作对象 */
    handleGrade(grade){
      this.queryParams.cooperativeObject=grade;
      this.getList();
      this.queryParams.cooperativeObject='';
    },
    /** 搜索技术领域 */
    handleTech(technology){
      this.queryParams.technology=technology;
      this.getList();
      this.queryParams.technology='';
    },

    handleDetail(id){
      /*getRoleId().then(res => {
        this.roleId = res;
        if(this.roleId==10){
          this.$modal.confirm('请先登录再进行操作').then(function () {
          }).then(() => {
            this.$router.push({ path:"/login1"});
          });
         /!* this.$modal.msgError("请先登录再进行操作");*!/
        }else{*/
      this.$router.push({ path:"/detail", query: {id}});

    },
    close() {
      this.$tab.closePage();
    },

    indexMethod(index) {
      return index +1;
    },

    handleClick(tab, event) {
      this.queryParams.firstCollege='';
      this.dateRange=[];
      console.log(tab, event);
    },

    /**
     * 初始化ws
     */
    wsInit() {
      // console.log("userName: " + this.$store.state.user.ipp)
      console.log("user: " + this.$store.state.constip.ipp)
      // const wsuri = 'ws://' + '210.47.178.218' + ':8080/library/wsService/' + this.$store.state.user.name
      this.getConfigKey("sys.account.ip").then(response => {
        this.sysipp = response.msg;
      });
      console.log("sysipp: " + this.sysipp)
      const wsuri = 'ws://' + this.sysipp + '/library/wsService/' +
        this.$store.state.constip.ipp + "_" + Math.floor(Math.random() * (99999 - 10000) + 10000);
      console.log("wsuri: " + wsuri)
      this.ws = wsuri
      if (!this.wsIsRun)
        return
      // 销毁ws
      this.wsDestroy()
      // 初始化ws
      this.webSocket = new WebSocket(this.ws)
      // ws连接建立时触发

      this.webSocket.addEventListener('open', this.wsOpenHanler)
      // ws服务端给客户端推送消息

      this.webSocket.addEventListener('message', this.wsMessageHanler)

      // ws通信发生错误时触发
      this.webSocket.addEventListener('error', this.wsErrorHanler)
      // ws关闭时触发

      this.webSocket.addEventListener('close', this.wsCloseHanler)

      clearInterval(this.wsTimer);
    },
    subSend(userId) {

      //获取msg的value
      // var msg = document.getElementById("msg").value;

      this.webSocket.send(userId);

      // ws服务端给客户端推送消息

      // document.getElementById("msg").value="";
    },


    wsOpenHanler(event) {
      console.log('ws建立连接成功')
    },
    wsMessageHanler(e) {

      //Cookies.set('unreadNums', '6')

      this.openMsg(e)
      //const redata = JSON.parse(e.data)
      //console.log(redata)

    },
    /**
     * ws通信发生错误
     */
    wsErrorHanler(event) {
      console.log(event, '通信发生错误')
      console.log("第" + this.wsNumber + "次断线重连(5次未连接将自动断开)")
      this.wsNumber++
      if (this.wsNumber < 6) this.wsInit();
      //this.wsInit()
    },
    /**
     * ws关闭
     */
    wsCloseHanler(event) {
      console.log(event, 'ws关闭')
      console.log("websocket连接超时，已自动断开")
      //this.wsInit()
    },
    /**
     * 销毁ws
     */
    wsDestroy() {
      console.log("hello world")
      if (this.webSocket !== null) {
        this.webSocket.removeEventListener('open', this.wsOpenHanler)
        this.webSocket.removeEventListener('message', this.wsMessageHanler)
        this.webSocket.removeEventListener('error', this.wsErrorHanler)
        this.webSocket.removeEventListener('close', this.wsCloseHanler)
        this.webSocket.close()
        this.webSocket = null
        clearInterval(this.wsTimer)
        console.log("zoul111")
      } else {
        console.log("zoul")
      }
    },
    /**
     * 弹窗
     */
    openMsg(e) {
      const h = this.$createElement;
      if (e.data) {
        console.log(e.data+"222")
        if(e.data==1) {
          this.$router.push({path: "/dashujuzhanshi/dashujushouye"})
        }
        else if(e.data==2){
          this.$router.push({path: "/shou"})
        }else if(e.data==3){
          this.$router.push({path: "/mwnhugongshi"})
        }else if(e.data==4){
          this.$router.push({path: "/liucheng"})
        }else if(e.data==5){
          this.$router.push({path: "/dashujuzhanshi/xueyuan"})
        }else if(e.data==6){
          this.$router.push({path: "/dashujuzhanshi/nianfen"})
        }else if(e.data==10){
          window.scrollBy(0, 100);
        }else if(e.data==11){
          window.scrollBy(0, -100);
        }else if(e.data==12){
          this.queryParams.signingStatus="0";
          console.log(this.queryParams.signingStatus)

        }else if(e.data==21){
          this.$router.push({path: "/ykqlogin3"})
        }  else if(e.data==22){
          this.$router.push({path: "/login4"})
        }else if(e.data==23){
          this.$router.push({path: "/login5"})
        }else if(e.data==24){
          this.$router.push({path: "/shou"})
        }else if(e.data==210){
          this.$router.push({path: "/index"})
        }else if(e.data==211){
          this.$router.push({path: "/transformation"})
        }else if(e.data==212){
          this.$router.push({path: "/wodehetong"})
        }else if(e.data==213){
          this.$router.push({path: "/expense"})
        }else if(e.data==214){
          this.$router.push({path: "/qiye"})
        }else if(e.data==215){
          this.$router.push({path: "/geren"})
        }else if(e.data==216){
          this.$router.push({path: "/chengguogongshi"})
        }else if(e.data==217){
          this.$router.push({path: "/daochuxinxi"})
        }else if(e.data==218){
          this.$router.push({path: "/resultapply"})
        }else if(e.data==13){
          this.queryParams.signingStatus="1";
          console.log(this.queryParams.signingStatus)
        }else if(e.data>500&&e.data<2000){
          let id=e.data-500
          this.$router.push({path: "/detail",query: {id}})

        } else{
          if(e.data>2000&&e.data<3000){
            let nianfen=e.data
            this.$router.push({path: "/dashujuzhanshi/xueyuan",query: {nianfen}})
          }else if(e.data>3000&&e.data<4000){
            let firstcollege=e.data
            let i_xueyuan=firstcollege-3000
            let xueyuan = '';
            if(i_xueyuan<10){
              xueyuan='00'+i_xueyuan;
            }else if(i_xueyuan>=10 && i_xueyuan<100){
              xueyuan='0'+i_xueyuan;
            }else{

            }
            this.$router.push({path: "/dashujuzhanshi/nianfen",query: {xueyuan}})
          }
          else{
            let userId=e.data
            this.$router.push({path: "/view",query: {userId}})}

        }
        /*var dv = document.getElementById("dv");
        dv.innerHTML += e.data + " ";*/
        /*this.$router.push({path: "/"});*/

        var data = JSON.parse(e.data)
        var route = this.$router;
        var msgType = data.msgType;
        /*if (msgType == "push") {
          // 如果是推送的是一条消息
          this.unreadMsgNums++;
          if (this.unreadMsgNums > 99) {
            this.unreadMsgNumsShow = "99+";
          } else {
            this.unreadMsgNumsShow = String(this.unreadMsgNums);
          }

          this.$notify.info({
            title: data.msgTitle,
            message: data.msgContent,
            onClick() {
              console.log(route)
              route.push({path: "/library/yyg/msg/list"});
            }
          });
        } else if (msgType == "unread") {
          // 如果推送的是未读消息数
          //Cookies.set('unreadNums', data.unreadNums);
          this.unreadMsgNums = Number(data.unreadNums);
          if (this.unreadMsgNums > 0) {
            this.unreadMsgNumsShow = String(this.unreadMsgNums);
            if (this.unreadMsgNums > 99) {
              this.unreadMsgNumsShow = "99+";
            }
            this.$notify.info({
              title: "消息提醒",
              //message: data.msgContent,
              message: "您当前有" + this.unreadMsgNumsShow + "条未读消息，点击此处查看",
              onClick() {
                console.log(route)
                route.push({path: "/library/yyg/msg/list"});
              }
            });
          }
        } else if (msgType == "read") {
          // 如果推送的是用户已读消息
          this.unreadMsgNums--;
          if (this.unreadMsgNums > 0 && this.unreadMsgNums <= 99) {
            this.unreadMsgNumsShow = String(this.unreadMsgNums);
          } else if (this.unreadMsgNums <= 0) {
            this.unreadMsgNumsShow = '';
          }
        }
  */
      }
    }

  }

};
</script>

<style lang="scss" scoped>
 .huadong {
    overflow-x: hidden; /*隐藏横向滚动条*/

  }

  .sx{
    border-style: none;
    width: 150px;
    height: 30px;

  }

  .an1{
    padding-top: 0px;
    margin-left: 2px;
    font-size: 22px;
    width: 100px;
    height: 60px;
    color: whitesmoke;
    border-style: none;
    background-color: #f04e0f;
  }
  .an6{
    font-size: 15px;
    width: 80px;
    height: 40px;
    color: whitesmoke;
    position: absolute;
    top: 20px; /* 设置相对于 .y2 容器的顶部位置 */
    right: 30px; /* 设置相对于 .y2 容器的左侧位置 */
  }
 .an2{
   font-size: 15px;
   width: 80px;
   height: 40px;
   color: whitesmoke;
   position: absolute;
   top: 20px; /* 设置相对于 .y2 容器的顶部位置 */
   right: 120px; /* 设置相对于 .y2 容器的左侧位置 */
 }
  .an3{
    font-size: 22px;
    font-weight: bold;
    width: 150px;
    height: 80px;
    border-style: none;
    border-radius: 0px;
    background-color: rgba(0, 0, 0, 0);
  }
  .an4{
    font-size: 15px;
    width: 80px;
    height: 40px;
    color: whitesmoke;
    position: relative;
    left: 40px; /* 假设要向右移动 20 像素 */
  }
  /*背景*/
  .bj{
    background-image: url("30.png");
    background-size: 100% 100%;
    height: 400px;

  }

  /*搜索框*/
  .sousuo {
    width: 800px;
    font-size: 22px;

  }
  ::v-deep .el-input__inner{
    height: 60px;
  }
  /*搜索框*/
  .custom-select::v-deep .el-input__inner {
    width: 300px;
    height: 30px;
    font-size: 12px;

  }
  /*搜索框*/
  .time-dage  {
    width: 300px;
    height: 30px;
    font-size: 12px;

  }
  .s1{
    display: flex;
    height: 80px;
    width: 100%;
    background-color: rgba(0, 0,0, 0.2);
  }
  .d1{

    background-size: 100% 100%;

    height: 400px;
    scroll-padding: 0;
    background-image: url("34.png");
    border-style: none;
    margin: 0;
    padding: 0;



  }
 /*卡片间距*/
 .box-card{
   margin-bottom: 8px;
 }
  .z1{
    width: 40%;
    height: 80px;
    background-color: #0574d0;
  }
  .y1{

    height: 80px;
    width: 50%;
    background-color: #0574d0;
  }

  .y2{
    display: flex;
    padding-top: 22px;
    padding-left: 65px;
    width: 15%;
    height: 80px;
    //background-color: rgba(0, 0, 0, 0);
    background-color: #0574d0;
    position: relative;
  }
 /*顶端固定*/
 .tou {
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
   height: 60px;
   background-color: #fff;
   z-index: 999;
 }

  .big_box{display: flex;height: 280px;}
  /*展示左图片*/
  .z{
    width: 25%;
    height: 250px;

  }
  /*展示中空白*/
  .c{
    width: 3%;
    height: 250px;
  }
  /*展示右信息*/
  .y{
    width: 70%;
    height: 250px;

  }
  /*按钮*/
  .an{
    height: 30px;
  }




  .dashboard-editor-container {
    overflow-x: hidden; /*隐藏横向滚动条*/
    padding: 32px;
    background-color: rgb(240, 242, 245);
    position: relative;

    .chart-wrapper {
      background: #fff;
      padding: 16px 16px 0;
      margin-bottom: 32px;
      padding-left: 30px;
    }

    .el-tabs .el-tabs__content {
      max-height: 100px;
      overflow: auto;
    }

  }

  @media (max-width:1024px) {
    .chart-wrapper {
      padding: 8px;
    }
  }

  /* 固定 应用board 宽度; */
  .el-tabs--card {
    height: calc(32vh);
    /* overflow-y: auto; */
  }

  .el-tab-pane {
    height: calc(32vh);
    overflow-y: auto;
    overflow-x: hidden;
  }
  .tag-style{
    height: 19px;
    color: #116fcf;
    font-family: 黑体;
    font-size: 13px;
    float: right;
    margin-right: 20px;
    line-height:15px;

  }
  .tag-menu-style{
    height: 19px;
    color: #116fcf;
    font-family: 黑体;
    font-size: 13px;
    float: right;
    margin-right: 0px;
    line-height:15px;
    margin-top: 5px;

  }

  .bannerimg{
    width: 100%;
    height: inherit;
  }
  /* 文字样式*/
  .carousel-p {
    background-color: rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 25px;
    line-height: 35px;
    text-align: center;
    padding-left: -28px;
    color: white;
    bottom: 66px;
    position: relative;
  }
  .el-icon-d-arrow-right{
    float: right;
    margin-right: 20px;
    padding-top: 5px;
    font-size:10px !important;
  }

  .is-selected {
    color: #1989FA;
  }


  /*日历自定义样式*/
  ::v-deep .el-calendar__header {
    // 修改头部背景颜色
    background-color: #FFFFFF;
    padding: 3px 5px;
    border: none;
    display: flex;
    justify-content: center;
    margin-top: 35px;

    .el-calendar__button-group {
      // 隐藏原生按钮
      display: none;
    }


    .el-calendar__title {
      // 修改头部标题的字体颜色
      color: #495060 !important;
      font-size: 20px;
      font-weight: bolder;
    }
  }

  ::v-deep .el-calendar__body {
    // 修改主题部分
    padding: 0;
  }

  ::v-deep .el-calendar-table {
    thead {
      th {
        // 修改头部星期部分
        padding: 5px;
        background-color: #2f81d5;
        color: white;
      }
    }

    .is-selected {
      .el-calendar-day {
        p {
          // 选中日期颜色
          color: black;
        }
      }
    }

    .el-calendar-day {
      // 每天小块样式设置
      padding: 0;
      height: 20px;
      display: flex;
      justify-content: center;
      align-items: center;

      p {
        // 所有日期颜色
        color: black;
        z-index: 1;
        user-select: none;
        display: flex;
      }
    }
  }

  ::v-deep .el-calendar-table__row {
    .prev, .next {
      // 修改非本月
      .el-calendar-day {
        p {
          color: #f0d9d5;
        }
      }
    }

    td {
      // 修改每一个日期td标签
      &:first-child, &:last-child {
        background-color: #f5f5f5;
      }
    }
  }

  button {
    padding: 3px 10px;
  }

  //隐藏el-tab-pane滚动条
  ::v-deep .el-tab-pane {
    height: calc(100vh - 110px);
    overflow-y: hidden;
  }


  ::v-deep .el-scrollbar__wrap {
    overflow-x: hidden!important;


  }

  ::v-deep .-webkit-scrollbar {
    /*隐藏滚轮*/
    display: none;
  }
  ::v-deep.el-table .warning-row {
    background: oldlace;
  }

  ::v-deep.el-table .success-row {
    background: #f0d9d5;
  }
  .pos1{

    position:absolute;             // 绝对定位,同时规定left和top
    left: 0;
    top:0;
  }


  //swiitch开关的样式
  ::v-deep .el-switch__core{
    width:30px!important;
    height:15px;

  }
  //111
  ::v-deep .el-tabs__nav-wrap.is-scrollable {
    margin-right: 40px;
    padding: 0 20px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
  }

  ::v-deep .el-switch__core::after{
    width:14px;
    height:14px;
    margin-top:-1px;
    margin-bottom: -4px;
  }
  ::v-deep.el-switch.is-checked .el-switch__core::after {
    left: 100%;
    margin-left: -14px;
  }

  //更改table表中文字的颜色
  ::v-deep.el-table{
    color: #000000;
  }

  //日程文字颜色
  ::v-deep.el-alert--success.is-light {
    background-color: #e7faf0;
    color: #000000;
  }
  ::v-deep.el-alert--success.is-light .el-alert__description {
    color: #507761;
  }


  /*数字加圈*/
  .number_top_circle {
    display: table-cell;
    border-radius: 18px;
    background-color: #4b9dfc;
    width: 25px;
    height: 25px;
    text-align: center;
    vertical-align: middle;
    color: #fff;
  }
  .number_top_circle_odd {
    display: table-cell;
    border-radius: 18px;
    background-color: #4b9dfc;
    width: 25px;
    height: 25px;
    text-align: center;
    vertical-align: middle;
    color: #fff;
  }

  //个人中心头像样式
  .user-avatar{
    border-radius: 50%;
    height:165px;
    border: 1px solid #409eff;

  }
  //去掉table表下面的边框线
  .el-table__row>td {
    border: none;
  }

  .el-table::before {
    height: 0px;
  }

  //纵向分割线
  ::v-deep.el-divider--vertical{

    height: 10em;
  }

  .selectBtn{
    background-color: #1482f0;
    color: #ffffff;
  }
  .fullscreen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
  }

  .loading-background {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    background-color: #F0F8FF;
  }

  .loading-text {
    font-size: 32px;
    font-weight: bold;
    color: #0000FF;
    margin-right: 20px;
  }

  .loading-spinner {
    border: 4px solid rgba(255, 255, 255, .3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
  }

  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
</style>
<!-- 日历table表的样式-->
<style>




  .el-image__error {
    font-size: 10px;

  }






  .size-icon{
    font-size: 25px;
  }

  .createInfo th, .createInfo tr {
    background-color: #409eff !important;
    color: #FFFFFF;
    text-align: center;

  }
  .createInfo tbody tr:hover>td {
    background-color: #409eff !important;
  }

  /*日期组件绝对定位*/
  .main{
    position: relative;

  }
  .target{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,0%);
  }


  /*menu中更多按钮*/
  .loginOut{
    /* position: absolute;right:23%;top:25px;*/
    position: absolute;right:26%;top:33px;
    color: #e6a23c;
    /*  font-weight: 600;
      font-size: 14px;*/
  }
  .grid-content{

    padding-left: 0%;
    padding-right: 0%;

  }


  /* 顶部列表 */
  .top-list-image{
    margin-right: 12px;
    font-size: 24px;
    width: 40px;
    padding-top: 0px;
    height: 40px;
    vertical-align: middle;
    text-align: center;
    border-radius:16px;
    color: #fff;
  }

  .top-list-col{
    height: 100px;
    padding: 10px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border-radius: 4px;
  }

  .top-list-span{
    max-width: 4em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis; /*超出部分用...代替*/
  }

</style>

